/**
 *
 */
package com.googlecode.bip.entity;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author Claude CHOISNET
 */
public class UserIgnoreQuestion
    implements Serializable, Comparable<UserIgnoreQuestion>, IUserIgnoreQuestion
{
    private static final long serialVersionUID = 1L;

    private int iduser; //key
    private int idquestion; //key

    /**
     * Create a NOT initialized UserIgnoreQuestion
     */
    public UserIgnoreQuestion()
    {
        //empty
    }

    /**
     * Create a shadow copy of giving UserIgnoreQuestion
     *
     * @param o UserIgnoreQuestion to clone
     */
    public UserIgnoreQuestion( final UserIgnoreQuestion o )
    {
        this.iduser     = o.iduser;
        this.idquestion = o.idquestion;
    }

    @Override
    public int compareTo( final UserIgnoreQuestion o )
    {
        if( o == null ) {
            return Integer.MIN_VALUE;
            }
        if( this == o ) {
            return 0;
            }

        int cmp = this.iduser - o.iduser;
        if( cmp != 0 ) { return cmp; }

        cmp = this.idquestion - o.idquestion;
        return cmp;
    }

    /**
     *
     * @param rSet
     * @return
     * @throws SQLException
     */
    public IUserIgnoreQuestion set( final ResultSet rSet ) throws SQLException
    {
        iduser      = rSet.getInt( "iduser" );
        idquestion  = rSet.getInt( "idquestion" );

        return this;
    }

    /* (non-Javadoc)
     * @see com.googlecode.bip.entity.IUserIgnoreQuestion#getIdUser()
     */
    @Override
    public int getIdUser()
    {
        return iduser;
    }

    /* (non-Javadoc)
     * @see com.googlecode.bip.entity.IUserIgnoreQuestion#setIdUser(int)
     */
    @Override
    public void setIdUser( int iduser )
    {
        this.iduser = iduser;
    }

    /* (non-Javadoc)
     * @see com.googlecode.bip.entity.IUserIgnoreQuestion#getIdQuestion()
     */
    @Override
    public int getIdQuestion()
    {
        return idquestion;
    }

    /* (non-Javadoc)
     * @see com.googlecode.bip.entity.IUserIgnoreQuestion#setIdQuestion(int)
     */
    @Override
    public void setIdQuestion( int idquestion )
    {
        this.idquestion = idquestion;
    }

}
